package com.ruoyi.system.service.impl.user;

import java.util.List;

import com.ruoyi.common.core.domain.model.VsUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.user.VsDramasUserWalletLogMapper;
import com.ruoyi.system.domain.user.VsDramasUserWalletLog;
import com.ruoyi.system.service.user.IVsDramasUserWalletLogService;

/**
 * 钱包日志Service业务层处理
 * 
 * @author zzx
 * @date 2024-04-30
 */
@Service
public class VsDramasUserWalletLogServiceImpl implements IVsDramasUserWalletLogService 
{
    @Autowired
    private VsDramasUserWalletLogMapper vsDramasUserWalletLogMapper;

    /**
     * 查询钱包日志
     * 
     * @param id 钱包日志主键
     * @return 钱包日志
     */
    @Override
    public VsDramasUserWalletLog selectVsDramasUserWalletLogById(Long id)
    {
        return vsDramasUserWalletLogMapper.selectVsDramasUserWalletLogById(id);
    }

    /**
     * 查询钱包日志列表
     * 
     * @param vsDramasUserWalletLog 钱包日志
     * @return 钱包日志
     */
    @Override
    public List<VsDramasUserWalletLog> selectVsDramasUserWalletLogList(VsDramasUserWalletLog vsDramasUserWalletLog)
    {
        VsUser vsUser = SecurityUtils.getLoginUser().getVsUser();
        vsDramasUserWalletLog.setUserId(vsUser.getId());

        return vsDramasUserWalletLogMapper.selectVsDramasUserWalletLogList(vsDramasUserWalletLog);
    }

    /**
     * 新增钱包日志
     * 
     * @param vsDramasUserWalletLog 钱包日志
     * @return 结果
     */
    @Override
    public int insertVsDramasUserWalletLog(VsDramasUserWalletLog vsDramasUserWalletLog)
    {
        vsDramasUserWalletLog.setCreatetime(System.currentTimeMillis());
        vsDramasUserWalletLog.setUpdatetime(System.currentTimeMillis());
        return vsDramasUserWalletLogMapper.insertVsDramasUserWalletLog(vsDramasUserWalletLog);
    }

    /**
     * 修改钱包日志
     * 
     * @param vsDramasUserWalletLog 钱包日志
     * @return 结果
     */
    @Override
    public int updateVsDramasUserWalletLog(VsDramasUserWalletLog vsDramasUserWalletLog)
    {
        vsDramasUserWalletLog.setUpdatetime(System.currentTimeMillis());
        return vsDramasUserWalletLogMapper.updateVsDramasUserWalletLog(vsDramasUserWalletLog);
    }

    /**
     * 批量删除钱包日志
     * 
     * @param ids 需要删除的钱包日志主键
     * @return 结果
     */
    @Override
    public int deleteVsDramasUserWalletLogByIds(Long[] ids)
    {
        return vsDramasUserWalletLogMapper.deleteVsDramasUserWalletLogByIds(ids);
    }

    /**
     * 删除钱包日志信息
     * 
     * @param id 钱包日志主键
     * @return 结果
     */
    @Override
    public int deleteVsDramasUserWalletLogById(Long id)
    {
        return vsDramasUserWalletLogMapper.deleteVsDramasUserWalletLogById(id);
    }
}
